<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>RVM : OptTestHarness</title>
	    <link rel="stylesheet" href="styles/site.css" type="text/css" />
        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">	    
    </head>

    <body>
	    <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
		    <tr>
			    <td valign="top" class="pagebody">
				    <div class="pageheader">
					    <span class="pagetitle">
                            RVM : OptTestHarness
                                                    </span>
				    </div>
				    <div class="pagesubheading">
					    This page last changed on Mar 09, 2007 by <font color="#0050B2">pdonald</font>.
				    </div>

				    <p>For optimizing compiler development, it is sometimes useful to exercise careful control over which classes are compiled, and with which optimization level.  In many cases, a <tt>prototype-opt</tt> image will suit this process using the command line option <tt>&#45;X:aos:initial_compiler=opt</tt> combined with <tt>&#45;X:aos:enable_recompilation=false</tt>.  This configuration invokes the optimizing compiler on each method run.The <tt>org.jikesrvm.tools.oth.OptTestHarness</tt> program provides even more control over the optimizing compiler.  This driver program allows you to invoke the optimizing compiler as an "application" running on top of the VM.</p>

<h3><a name="OptTestHarness-CommandLineOptions"></a>Command Line Options</h3>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<td class='confluenceTd'> &#45;useBootOptions </td>
<td class='confluenceTd'> Use the same OptOptions as the bootimage compiler. </td>
</tr>
<tr>
<td class='confluenceTd'> &#45;longcommandline &lt;filename&gt; </td>
<td class='confluenceTd'> Read commands (one per line) from a file </td>
</tr>
<tr>
<td class='confluenceTd'> &#43;baseline </td>
<td class='confluenceTd'> Switch default compiler to baseline </td>
</tr>
<tr>
<td class='confluenceTd'> &#45;baseline </td>
<td class='confluenceTd'> Switch default compiler to optimizing </td>
</tr>
<tr>
<td class='confluenceTd'> &#45;load  &lt;class&gt; </td>
<td class='confluenceTd'> Load a class </td>
</tr>
<tr>
<td class='confluenceTd'> &#45;class &lt;class&gt; </td>
<td class='confluenceTd'> Load a class and compile all its methods </td>
</tr>
<tr>
<td class='confluenceTd'> &#45;method &lt;class&gt; &lt;method&gt; [&#45; or &lt;descrip&gt;] </td>
<td class='confluenceTd'> Compile method with default compiler </td>
</tr>
<tr>
<td class='confluenceTd'> &#45;methodOpt &lt;class&gt; &lt;method&gt; [&#45; or &lt;descrip&gt;] </td>
<td class='confluenceTd'> Compile method with opt compiler </td>
</tr>
<tr>
<td class='confluenceTd'> &#45;methodBase &lt;class&gt; &lt;method&gt; [&#45; or &lt;descrip&gt;] </td>
<td class='confluenceTd'> Compile method with base compiler </td>
</tr>
<tr>
<td class='confluenceTd'> &#45;er &lt;class&gt; &lt;method&gt; [&#45; or &lt;descrip&gt;] {args} </td>
<td class='confluenceTd'> Compile with default compiler and execute a method </td>
</tr>
<tr>
<td class='confluenceTd'> &#45;performance </td>
<td class='confluenceTd'> Show performance results </td>
</tr>
<tr>
<td class='confluenceTd'> &#45;oc </td>
<td class='confluenceTd'> pass an option to the optimizing compiler </td>
</tr>
</tbody></table>
</div>


<h3><a name="OptTestHarness-Examples"></a>Examples</h3>

<p>To use the <tt>OptTestHarness</tt> program:</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>% rvm org.jikesrvm.tools.oth.OptTestHarness -class Foo
</pre>
</div></div>
<p>will invoke the optimizing compiler on all methods of class <tt>Foo.</tt></p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>% rvm org.jikesrvm.tools.oth.OptTestHarness -method Foo bar -
</pre>
</div></div>
<p>will invoke the optimizing compiler on the first method <tt>bar</tt> of class <tt>Foo</tt> it loads.</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>% rvm org.jikesrvm.tools.oth.OptTestHarness -method Foo bar '(I)V;'
</pre>
</div></div>
<p>will invoke the optimizing compiler on method <tt>Foo.bar(I)V;</tt>.<br/>
You can specify any number of <tt>&#45;method</tt> and <tt>&#45;class</tt> options on the command line.  Any arguments passed to <tt>OptTestHarness</tt> via <tt>&#45;oc</tt> will be passed on directly to the optimizing compiler.  So:</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>% rvm org.jikesrvm.tools.oth.OptTestHarness -oc:O1 -oc:print_final_hir=true -method Foo bar -
</pre>
</div></div>
<p>will compile <tt>Foo.bar</tt> at optimization level <tt>O1</tt> and print the final HIR. </p>

				    
                    			    </td>
		    </tr>
	    </table>
	    <table border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr>
				<td height="12" background="http://docs.codehaus.org/images/border/border_bottom.gif"><img src="images/border/spacer.gif" width="1" height="1" border="0"/></td>
			</tr>
		    <tr>
			    <td align="center"><font color="grey">Document generated by Confluence on Jul 04, 2010 19:57</font></td>
		    </tr>
	    </table>
    </body>
</html>